package com.booby.algorithm.recursion;

/**
 * 功能描述: 递归demo
 *
 * @author: lizt
 * @date: 2020/8/23 15:56
 **/

public class Recursion {

    public static void main(String[] args) {
        int total = plus(50);
        System.out.println(total);
    }

    public static Integer plus(Integer i){

        if (i == 1){
            return 1;
        }else{
            return i + plus(i-1);
        }
    }
}
